package com.usthe.bootshiro;

/**
 * @author earthchen
 * @date 2018/9/3
 **/
public enum Singleton {
    INSTANCE;

    private Singleton() {
    }


    public static void main(String[] args) {
//        Singleton ob1=Singleton.INSTANCE;
//        Singleton ob2=Singleton.INSTANCE;
//
//        System.out.println(ob1==ob2);
//        System.out.println(ob1.hashCode()==ob2.hashCode());

        String s1=new String("A");
        String s2="A";

        System.out.println(s2==s1.intern());
        System.out.println(s2.intern()==s1);
    }

}
